#include <stdio.h>
#include <stdlib.h>

void sort(int n, int arr[])
{
    int i = 0;
    for(i = 0; i < n; i++)//arr[0]和arr[i]对应
    {
        int x = 1;
        int* ret = (int*)malloc(sizeof(int) * n);
        int* test = (int*)malloc(sizeof(int) * n);
        for(int h = 0; h < n; h++)
        {
            test[h] = 1;
        }
        ret[0] = i;
        test[i] = 0;
        int tmp = arr[0] + arr[i];
        int j = 1;
        for(j = 1; j < n; j++)//后面元素找对应
        {
            int flag = 1;
            for(int k = 0; k < n; k++)
            {
                if((tmp == arr[j] + arr[k])&&test[k] != 0)//找到对应元素
                {
                    flag = 0;
                    test[k] = 0;
                    ret[x] = k;
                    x++;
                    break;
                }
            }
            if(flag)//某号元素找不到对应
            break;
        }
        if(j == n)//找全了
        {
            for(int y = 0; y < n; y++)
            {
                printf("%d ", ret[y]+1);
            }
            break;
        }
        free(ret);
        free(test);
    }
    if(i == n)
    printf("-1\n");
}

int main()
{
    int n = 0, k = 0;
    k = scanf("%d", &n);
    int* arr = (int*)malloc(sizeof(int) * n);
    for(int i = 0; i < n; i++)
    {
        k = scanf("%d", &arr[i]);
    }
    sort(n, arr);
    free(arr);
    return 0;
}